import request from '@/utils/request'

/**
 * 
 * @param {*} params   查询列表
 * @returns 
 */
export const getDepartmentsListApi = (params) => {
  return request({
    url: '/company/department',
    method: 'GET',
    params
  })
}

/** *
 *
 * 查询单个数据
 * **/
export const getDepartmentsInfoApi = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

/** *
 *
 * 添加
 * **/
export const addDepartmentstApi = (data) => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * 修改数据
 * @param {*} data 参数
 * @returns
 */
export const editDepartmentsApi = (data) => {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

/**
 *
 * @param {*} id
 * @returns
 */

export const delDepartmentsApi = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

